const sub = [
    {
        // 引导页
        path: '/welcome',
        name: 'Guide',
        meta: {
            name: 'guide',
            title: '欢迎使用',
            comp: 'Welcome'
        },
        component: () => import('@/views/Guide/guide')
    },
    {
        // 首页
        path: '/index',
        name: 'Index',
        meta: {
            name: 'index',
            title: '首页',
            comp: 'Index'
        },
        component: () => import('@/views/index/Index')
    },
    {
        path: '/search',
        name: 'Search',
        component: () => import('@/views/OneClickSearch/GoSearch.vue')
    },
    {
        // 人员管理
        path: '/person_manage',
        name: 'PersonManage',
        meta: {
            name: 'PersonManage',
            title: '人员管理',
            comp: 'manage'
        },
        component: () => import('@/views/PersonManage/manage')
    },
    {
        // 案件管理
        path: '/case_manage',
        name: 'CaseManage',
        meta: {
            name: 'CaseManage',
            title: '案件管理',
            comp: 'CaseManage'
        },
        component: () => import('@/views/CaseManage/manage')
    },
    {
        // 现案研判
        path: '/person_involved',
        name: 'involved',
        meta: {
            name: 'involved',
            title: '现案研判',
            comp: '现案研判'
        },
        component: () => import('@/views/CaseManage/involved')
    }
];

const home = [
    {
        path: '/home',
        name: 'Home',
        component: () =>
            import(/* webpackChunkName: "home" */ '@/views/Home'),
        // redirect: '/guide',
        children: sub.map(tmp => {
            const item = JSON.parse(JSON.stringify(tmp));
            item.path = '/home' + item.path;
            item.name = 'home-' + item.name;
            return item;
        })
    }
].concat(sub);

export default home;
